<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.0/css/jquery.dataTables.css"></link>

<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<link rel="stylesheet" href="/js/chosen/chosen.css" />
<script type="text/javascript" language="javascript">
jQuery.fn.dataTableExt.oApi.fnGetHiddenNodes = function ( settings )
{
    var nodes;
    var display = jQuery('tbody tr', settings.nTable);
 
    if ( jQuery.fn.dataTable.versionCheck ) {
        // DataTables 1.10
        var api = new jQuery.fn.dataTable.Api( settings );
        nodes = api.rows().nodes().toArray();
    }
    else {
        // 1.9-
        nodes = this.oApi._fnGetTrNodes( settings );
    }
 
    /* Remove nodes which are being displayed */
    for ( var i=0 ; i<display.length ; i++ ) {
        var iIndex = jQuery.inArray( display[i], nodes );
 
        if ( iIndex != -1 ) {
            nodes.splice( iIndex, 1 );
        }
    }
 
    return nodes;
};

$(document).ready(function() {
   oTable = $('#product_table').dataTable();
    
   $('form').submit(function(){
      $(oTable.fnGetHiddenNodes()).find('input:hidden').appendTo(this);
   });
} );


$(function(){
	$("#code_product").keydown(function(e){
	    if(e.keyCode == 13){
	    	e.preventDefault();
	    }
	  });
});
function refocus(theid){
	
	if(theid !=""){
		document.getElementById(theid).focus();
		}
	}

	</script>
</head>
<body>
<div style="font-family:Arial, Helvetica, sans-serif;" >
<h1>Equipment Record:</h1>

<form id="form1" name="form1" method="post" action="" enctype="multipart/form-data">
<?php $eqInfo = $this->arrDes;$jsFile = "roster_js_0603.js";$stDetail = new Model_DbTable_Roster_Stafflogindetail();
  		$st = new Model_DbTable_Roster_Staffinfo();$stList = $stDetail->listStaffByNickName();$shopList = unserialize(ARR_SHOP);?>
<?php if($this->isNew == true){?>Equipment Description Not Available,Please Verify Barcode <?php }?>
<table border="1" cellspacing="0" cellpadding="5">
	<tr>
		<th colspan="2" scope="col">Sent Equipment Record Add</th>
	</tr>
	<tr>
		<td>Barcode</td>
		<td><input name = "barcode" id = "barcode" type="text" value = "<?php echo $this->barcode?>"></input></td>
	</tr>
	<tr>
		<td>Equipment</td>
		<td><input name = "equipment_name" id = "equipment_name" type="text" value = "<?php echo $eqInfo[0]?>"></input></td>
	</tr>
	<tr>
		<td>Model No</td>
		<td><input name = "model_no" id = "model_no" type="text" value = "<?php echo $eqInfo[1]?>"></input></td>
	</tr>
	<tr>
		<td>S/N No</td>
		<td><input name = "sn_no" id = "sn_no" type="text" value = "<?php echo $eqInfo[2]?>"></input></td>
	</tr>
	<tr>
		<td>Reason</td>	
		<td><input name = "reason" id = "reason" type="text"></input></td>
	</tr>
	<tr>
		<td>Shop/Staff</td>
		<td><select name="receiver" data-placeholder="Please Choose" class="chzn-select" style="width:200px" >
		
		
      <option value=""></option>
      <?php foreach($stList as $k3 => $v3) {
      $stf = $st->getStaffinfo($v3['id']);
      	
      	?>
      <option value="<?=$v3["id"]?>">
        <?=ucwords($v3["ni"])?>
        .
        <?=chr($v3["il"]+64)?> ( <?=ucwords(Model_EncryptHelper::getSslPassword($v3["n"]))?> )
        </option>
      <?php }?>
      <?php foreach ($shopList as $k2 => $v2){?>
		<option value = "<?php echo $v2?>"><?php echo $v2?></option>
		<?php }?>
		<option value = "WH" >WH</option>
    </select>
    </td>
	</tr>
	<tr>
		<td>Input Password</td>
		<td><input type = "password" name = "password" ></input></td>
	</tr>
	<tr>
		<td colspan="2" scope="col"><input name="submit" id = "submit" type = "submit" value = "Sent" ></input></td>
	</tr>
	

</table>
<br />
<h2>Equipment History </h2>
<table width="1100" border="1" cellspacing="0" cellpadding="10" style="font-size:13px;" id="product_table">
<thead> 
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Barcode</th>
    <th scope="col">Equipment Name</th>
    <th scope="col">Model No</th>
    <th scope="col">S/N</th>
    <th scope="col">Shop/Staff</th>
    <th scope="col">Confirm Received</th>
    <th scope="col">Date</th>
    <th scope="col">Reason</th>
  </tr>
 </thead> 
 <tfoot> 
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Barcode</th>
    <th scope="col">Equipment Name</th>
    <th scope="col">Model No</th>
    <th scope="col">S/N</th>
    <th scope="col">Shop/Staff</th>
    <th scope="col">Confirm Received</th>
    <th scope="col">Date</th>
    <th scope="col">Reason</th>
  </tr>
  
 </tfoot>  
 <tbody>
  <?php $i = 1;?>
  <?php foreach($this->list as $k => $v){?>
  <tr>
  		<td align="center"><?php echo $i?></td>
  		<td align="center"><?php echo $v['barcode']?></td>
  		<td align="center"><?php echo $v['equipment_name']?></td>
		<td align="center"><?php echo $v['model_no']?></td>
		<td align="center"><?php echo $v['s_n']?></td>
		<td align="center"><?php echo $v['shop']?></td>
		<td align="center" <?php if($v['action'] == 'Input'){?> bgcolor = "green" <?php }else{?>bgcolor = "red"<?php }?>><?php if($v['action'] == 'Input'){echo 'Yes';}else{echo 'No';}?></td>
		<td align="center"><?php echo $v['date']?></td>
		<td align="center"><?php echo $v['reason']?></td>
  </tr>
  <?php $i++;}?>
  </tbody>
  
</table>

<br />
</form>
</div>
 <script src="/js/chosen/chosen.jquery.js" type="text/javascript"></script>
  <script type="text/javascript"> 
    var config = {
      '.chzn-select': {allow_single_deselect:true},
    }
    for (var selector in config) {
      $(selector).chosen(config[selector]);
    }
  </script>
  <script src="/js/<?php echo $jsFile;?>" type="text/javascript"></script>
<div style=" font-size:10px; color:#666;float:right;" >Developer:Leo,Date:2015-02-01,,ver:1.01</div>
</body>
</html>
